package com.great.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.great.dao.WebInfoMapper;
import com.great.model.pojo.UserInfo;
import com.great.model.pojo.WebInfo;
import com.great.service.IWebInfoService;

@Service
public class WebInfoService implements IWebInfoService {
	@Resource
	private WebInfoMapper webInfoMapper;
	@Override
	public void sAddWeb(WebInfo webInfo) {
		webInfoMapper.addweb(webInfo);
	}
	@Override
	public List<WebInfo> sSelectWebByName(String selectStr) {
		List<WebInfo> webInfos=null;
		if (selectStr.equals("")) {
			webInfos=webInfoMapper.selectAllWeb(selectStr);
		}else {
			webInfos=webInfoMapper.selectwebbyname(selectStr);
		}
		return webInfos;
	}
	@Override
	public List<WebInfo> sSelectWebByBigType(String selectStr) {
		List<WebInfo> webInfos=null;
		if (selectStr.equals("")) {
			webInfos=webInfoMapper.selectAllWeb(selectStr);
		}else {
			webInfos=webInfoMapper.selectwebbybigtype(selectStr);
		}
		return webInfos;
	}
	@Override
	public List<WebInfo> sSelectWebByType(String selectStr) {
		List<WebInfo> webInfos=null;
		if (selectStr.equals("")) {
			webInfos=webInfoMapper.selectAllWeb(selectStr);
		}else {
			webInfos=webInfoMapper.selectwebbytype(selectStr);
		}
		return webInfos;
	}
	@Override
	public void sUpdataWeb(WebInfo webInfo) {
		webInfoMapper.updataWeb(webInfo);		
	}
	@Override
	public void sDeleteWeb(WebInfo webInfo) {
		webInfoMapper.deleteWeb(webInfo);
	}

}
